﻿namespace org.xisoft.game.utils.game
{
    public class MoveAction
    {
        public int ToX { get; set; }
        public int ToY { get; set; }

        public int FromX { get; set; } = -1;
        public int FromY { get; set; } = -1;

        public ChessItem OldChessman { get; set; }
        public ChessItem CurrentChessman { get; set; }
        public MoveAction Next { get; set; }

        public long Score { get; set; }

        public override string ToString()
        {
            if(FromX>=0 && FromY>=0)
            {
                return "{(x=" + (char)(FromX + 'A') + " y=" + (FromY + 1) + ") ==> ("+ (char)(ToX + 'A') + " y=" + (ToY + 1) + ") score=" + Score + "}";
            }
            return "{x=" + (char)(ToX + 'A') + " y=" + (ToY + 1) + " score=" + Score + "}";
        }
    }
}
